<template>
  <div>
    <el-pagination
          :current-page="page"
          :page-sizes="[10, 20, 30, 40]"
          :page-size="pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
          @size-change="handleSizeCZChange"
          @current-change="handleCurrentCZChange"
        >
        </el-pagination>
  </div>
</template>

<script>
export default {
  data() {
    return {
      pageSize: 10,
      page: 1,
    }
  },
  props: {
    total: Number,
    pageSize: Number,
    page: Number,
  },
  methods: {
    handleSizeCZChange(val) {
      this.pageSize = val
      this.$emit('pageSize',val)
    },
    handleCurrentCZChange(val) {
      this.page = val
      this.$emit('page',val)
    }
  }
}
</script>
<style scoped>
.el-pagination {
  display: flex;
  justify-content: flex-end;
  margin-top:15px;
}
</style>
